add support for array output and by reference #198
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
adds final support for arrays, by supporting output and reference arrays.
These two implementations are fairly similar, so that's why i did them in one go. The only difference is that for output arrays the callee allocates the buffer (via
CoTaskMemAlloc
) and in reference arrays, the caller pre-allocates the buffer and it is filled in by the callee. Since Swift doesn't have true "out" params, the APIs for these on the Swift side are identical (bothinout [T]
) which could lead to some confusion. Possible improvement may be to use something likeArraySlice
for reference arrays?Changes
Array+ToABI.swift
to support allocating+filling a WinRT buffer.Array+ToABI.swift
to use the sameWinRTArrayABI
typealias thatArray+FromAbi.swift
uses. This made code-gen simplerGetGlyphIndices
as this conflicts with Win2D API (would love to not use any Windows headers!!)Arc builds/runs with the needed changes to remove the handwritten APIs we created due to lack of array support in swift-winrt.